package com.admin.interfaces.facade.assembler;

import com.admin.domain.model.Menu;
import com.admin.infrastructure.BeanUtil;
import com.admin.interfaces.facade.commandobject.MenuCreateCommand;
import com.admin.interfaces.facade.commandobject.MenuUpdateCommand;


/**
 * @author Jonsy
 */
public class MenuAssembler {

    public static Menu updateCommandToDomain(String id, MenuUpdateCommand updateCommand){
        Menu menu = new Menu();
        BeanUtil.copeProperties(updateCommand, menu);
        menu.setId(id);
        return menu;
    }

    public static Menu createCommendToDomain(MenuCreateCommand creteCommand){
        Menu menu = new Menu();
        BeanUtil.copeProperties(creteCommand, menu);
        return menu;
    }
}
